<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>javascript脚本语言案例dom树</title>
	</head>
	<body>
		<h1>JavaScript 脚本语言 之 dom树</h1>
		
		<a href="http://www.taobao.com" target="_blank" name="taobao">淘宝</a>
		<a href="http://www.jd.com" target="_blank" class="jd">京东</a>
		<a href="http://pingduo.com" target="_blank" id="pd">拼多多</a>
		
		<button onclick='alert( document.getElementsByTagName("a").length );'>A标签数量</button>
		<button
			onclick="alert( document.getElementsByName('taobao')[0].href );"
		>A 淘宝链接</button>
		<button
			onclick="alert( document.getElementsByName('taobao')[0].innerText );"
		>A 淘宝内容</button>
	</body>
	
	<script>
		
	</script>
</html>
